from app_server_function.UserClient import userClient
from utils.log_util import logger
import argparse


def audit_main(login_name, login_password):
    logger.info(f"开始登录账号{login_name}")
    userClient.user_login(login_name, login_password)
    logger.info(f"结束登录账号{login_name}\n")

    logger.info(f"开始注销账号{login_name}")
    userClient.userAccountCancel()
    logger.info(f"注销账号结束{login_name}\n")


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='执行注销app用户操作')
    parser.add_argument('login_name', type=str, help='登录账号')
    parser.add_argument('login_password', type=str, help='登录密码')
    args = parser.parse_args()

    audit_main(args.login_name, args.login_password)
